package com.zzyl.controller.customer;

import com.zzyl.base.ResponseResult;
import com.zzyl.dto.UserLoginRequestDto;
import com.zzyl.service.MemberService;
import com.zzyl.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description CustomerUserController
 * @Author loe
 * @Date 2024-07-11
 */

@RestController
@Api(tags = "客户管理")
@RequestMapping("/customer/user")
public class CustomerUserController {
    @Autowired
    private MemberService memberService;

    /**
     * 小程序登录
     * @param userLoginRequestDto
     * @return
     */
    @PostMapping("/login")
    @ApiOperation(value = "登录")
    public ResponseResult<LoginVo> login(@RequestBody UserLoginRequestDto userLoginRequestDto) {
        LoginVo loginVo = memberService.login(userLoginRequestDto);
        return ResponseResult.success(loginVo);
    }
}
